using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class 堆垛机10kg_Contor : MonoBehaviour
{
    public Animator animator_10kg堆垛机;
    public event Action<int> switch_10kg堆垛机;
    private void Awake()
    {
    }
    void Start()
    {
        //animator_10kg堆垛机.SetInteger("playClips", 0);
        //animator_10kg堆垛机.SetBool("a",true);

        //switch_10kg堆垛机1 += contor_V;
    }

    public void contor_V(int leayPile)
    {
        Debug.Log("V");
        animator_10kg堆垛机.SetInteger("playClips", 0);
        if (leayPile < 6)
        {
            if (leayPile % 2 == 0)
            {
                animator_10kg堆垛机.SetInteger("playClips", 0);
            }
            else
            {
                animator_10kg堆垛机.SetInteger("playClips", 1);
            }
        }
        else if(leayPile < 14 && leayPile >=6)
        {
            if (leayPile % 2 == 0)
            {
                animator_10kg堆垛机.SetInteger("playClips", 2);
            }
            else
            {
                animator_10kg堆垛机.SetInteger("playClips", 3);
            }
        }
        else if (leayPile >= 14)
        {
            if (leayPile % 2 == 0)
            {
                animator_10kg堆垛机.SetInteger("playClips", 4);
            }
            else
            {
                animator_10kg堆垛机.SetInteger("playClips", 5);
            }
        }

    }
    public void SetPlay(int leayPile)
    {
        if (leayPile%2 == 0)
        {
            animator_10kg堆垛机.SetInteger("playClips", 0);
        }
    }

    public void contor_H()
    {
        animator_10kg堆垛机.SetInteger("playClips", 1);
        //animator_10kg堆垛机.SetInteger("playClips", -1);
    }

    public void SetIngotArrParent(int parent_int)
    {
        animator_10kg堆垛机.SetInteger("playClips", -1);
        switch_10kg堆垛机?.Invoke(parent_int);
    }
    

   
}
